﻿using Model.Interfaces;
using Model.NotifyingCollections;

namespace Model.ModelClasses
{
    public class Student : Person, IStudent 
    {
        public NotifyingModelList Groups { get; set; }
        public IFaculty Faculty { get; set; }
        public bool IsBenefit { get; set; }
        public ISchool School { get; set; }
        public NotifyingModelHashMap Payments { get; set; }
        public NotifyingModelHashMap TestResults {get; set; }
		private string getGroup(string gr)
        {
             string res = "";
             if (Groups != null)
                 foreach (Group g in Groups)
                 {
                     if (g.Name.StartsWith(gr+"-"))
                     {
                         res = g.Name.Substring(gr.Length+1);
                         break;
                     }
                 }
             //else res = "null";
            return res; 
        }
        public string A { get { return getGroup("А"); } }
        public string B { get { return getGroup("Б"); } }
        public string G { get { return getGroup("Г"); } }
        public string I { get { return getGroup("И"); } }
        public string M90 { get { return getGroup("М90"); } }
        public string M60 { get { return getGroup("М60"); } }
        public string T { get { return getGroup("Т"); } }
        public string U { get { return getGroup("У"); } }
        public string Ulit { get { return getGroup("Улит"); } }
        public string UplusL { get { return getGroup("У+Л"); } }
        public string F { get { return getGroup("Ф"); } }
        public string H { get { return getGroup("Х"); } }
    }
}